package com.weijian.common;

/**
 * 业务异常类
 * 
 * @author weijian
 * @since 2024-12-20
 */
public class BusinessException extends RuntimeException {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 错误码
     */
    private final int code;
    
    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }
    
    public BusinessException(String message) {
        this(500, message);
    }
    
    public int getCode() {
        return code;
    }
}